import 'package:flutter/material.dart';
import 'dart:math';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Transform.rotate with Origin'),
        ),
        body: Center(
          child: Stack(
            alignment: Alignment.center,
            children: [
              // Background container for reference
              Container(
                width: 200,
                height: 200,
                color: Colors.grey.withOpacity(0.3),
              ),
              // Rotated container
              Transform.translate(
                offset: Offset(100, 20), // 向右平移50，向下平移100
                // alignment: Alignment.topLeft, // 绕左上角旋转
                child: Container(
                  width: 100,
                  height: 100,
                  color: Colors.blue,
                  child: Center(
                    child: Text(
                      'translate',
                      style: TextStyle(color: Colors.white, fontSize: 16),
                    ),
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
